<script>
import store from "./store";
export default {
  globalData: {
    windowHeight: 0,
    navHeight: 0, //导航高度
    mainWidth: 0, //获取设备宽度
  },
  onLaunch: function () {
    // uni.hideTabBar();
    let that = this;
    // 获取页面高度
    uni.getSystemInfo({
      success: function (res) {
        // 首页没有title获取的整个页面的高度，里面的页面有原生标题要减掉就是视口的高度
        // 状态栏是动态的可以拿到 标题栏是固定写死的是44px
        // let height = res.windowHeight - res.statusBarHeight - 44;
        // #ifdef H5 || APP-PLUS
        that.globalData.windowHeight = res.windowHeight + "px";
        // #endif
        // 获取导航高度；
        that.globalData.navHeight =
          res.statusBarHeight * (750 / res.windowWidth) + 91;
        // 获取设备宽度；
        that.globalData.mainWidth = res.windowWidth;
        store.commit(
          "GLOBAL_DATA",
          JSON.parse(JSON.stringify(that.globalData))
        );
        store.commit("SYSTEM_PLATFORM", res.platform.toLowerCase());
      },
    });
    console.log("App Launch");
  },
  onShow: function () {
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
};
</script>

<style lang="scss">
/* #ifndef APP-PLUS-NVUE || APP-NVUE */
@import "static/css/base.css";
@import "static/css/unocss.css";
@import "static/fonts/font.css";
@import "static/iconfont/iconfont.css";

view {
  box-sizing: border-box;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
  display: none;
}

.bg-color-red {
  background-color: #e93323;
}

.syspadding {
  padding-top: var(--status-bar-height);
}

/deep/.uni-scroll-view::-webkit-scrollbar {
  /* 隐藏滚动条，但依旧具备可以滚动的功能 */
  display: none;
}

::-moz-scrollbar {
  width: 0;
  height: 0;
  color: transparent;
}

::-webkit-scrollbar {
  display: none;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none;
  background: transparent;
}

/*#endif*/
/*每个页面公共css */
</style>
